package com.lagou.mapper;

import com.lagou.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author ADMIN
 * @date 2021/3/28 20:44
 */
public interface IUserMapper {
    /**
     * 添加用户
     *
     * @param user
     */
    @Insert("insert into user values(#{id},#{username},#{password},#{birthday})")
    public void addUser(User user);

    /**
     * 更新用户
     *
     * @param user
     */
    @Update({"update  user set username =#{username} where id=#{id}"})
    public void updateUser(User user);

    /**
     * 删除用户
     *
     * @param user
     */
    @Delete("delete from user where id= #{id}")
    public void delUser(User user);
    /**
     * 查找用户
     *
     * @param
     */
    @Select("select * from user ")
    public List<User> findAll();


}
